================================================================================
METHODOLOGICAL FRAMEWORK: CITY-WIDE TRANSIT AND AMENITY SUITABILITY ANALYSIS
================================================================================

1. INTRODUCTION AND OBJECTIVE
This process employs a raster-based Multi-Criteria Evaluation (MCE) methodology to assess city-wide urban suitability and accessibility. The objective is to model the spatial quality of the urban environment by calculating the proximity to civic amenities (e.g., schools, markets, transit) while penalizing for environmental nuisances (e.g., traffic noise, surface tram lines). The model assumes a fully realized transit network (Metro Lines 1 and 2 combined) and evaluates the entire city boundary at a high-resolution 5-meter grid.

2. THEORETICAL FRAMEWORK AND SPATIAL ANALYSIS PRINCIPLES

2.1. Raster-Based Map Algebra and Multi-Criteria Evaluation (MCE)
The script shifts from vector-based geometries to a continuous raster surface (Rasterization). This approach allows for the mathematical combination of multiple spatial variables using Map Algebra (Tomlin, 1990). By employing MCE (Malczewski, 1999), the model integrates diverse, conflicting criteria (amenities vs. disamenities) into a single composite index of suitability.

2.2. Euclidean Proximity and Distance Decay (Fuzzy Logic)
Rather than using rigid Boolean buffers (e.g., "within 500m" = 1, "outside" = 0), the model applies continuous distance-decay functions using the Exact Euclidean Distance Transform (distance_transform_edt). This aligns with Fuzzy Set Theory in spatial analysis (Jiang & Eastman, 2000), acknowledging that the utility of an amenity decreases gradually with distance. 
The script employs two primary decay topologies:
* Dual/Booster: Provides maximum suitability near the feature, decaying linearly to zero at a defined outer boundary.
* Detractor: Penalizes extreme proximity (e.g., immediately next to a hospital or police station), with suitability increasing linearly until a safe distance is reached.

2.3. Environmental Nuisance Modeling (CNOSSOS-EU)
To model the spatial attenuation of traffic noise, the script applies logic derived from the CNOSSOS-EU (Common Noise Assessment Methods in Europe) framework (Kephalopoulos et al., 2012). Instead of static buffers, it dynamically calculates acoustic propagation based on continuous variables: vehicle speed (v) and traffic volume/flow (q_l for light, q_h for heavy vehicles) to derive sound power levels (L_W). A target decibel threshold (60 dB) is used to establish the maximum spatial reach of the noise penalty.

3. COMPUTATIONAL WORKFLOW

Step 1: Base Amenity Rasterization
Vector geometries for various urban services (schools, markets, safety infrastructure) are read via the Pyogrio engine for performance. Each layer is rasterized, and its Euclidean distance surface is computed. The specific distance-decay functions are applied to generate suitability scores (0-100), which are then multiplied by predefined criteria weights and summed to create a "Base Suitability" surface.

Step 2: Nuisance Surface Generation
Disamenities are processed to create penalty surfaces:
* Dynamic Roads: Traffic volumes are passed through the CNOSSOS-EU equations to generate variable-width noise buffers. The penalty severity decays from the road centerline outward.
* Static Nuisances: Surface tram lines and tram stops utilize static impact buffers (50m and 100m, respectively) with a linear decay penalty.
These grids are aggregated into a "Total Noise Penalty" raster.

Step 3: Unified Transit Network Amalgamation
To evaluate the final spatial impact of the mass transit system, Metro Line 1 and Metro Line 2 datasets are concatenated into a single, unified spatial dataframe. This ensures that the distance algorithm accurately identifies the absolute nearest station for any given pixel, regardless of which specific line it belongs to. The transit network is subjected to a "Dual" distance decay function, penalizing immediate adjacency (to account for localized congestion/noise) while heavily boosting regional proximity up to 800m.

Step 4: Integration and Min-Max Normalization
The transit suitability is integrated with the base amenity suitability. To prevent skewed distributions and ensure interpretability within the dashboard, a strict Min-Max Normalization is applied, scaling all valid data points proportionally between 0 and 100. 

Step 5: City Boundary Masking and Export
A binary mask is generated from the city's administrative boundaries (asc_base_pop). Map algebra is used to exclude (assign NaN) any calculated pixels falling outside this boundary. The final 32-bit floating-point raster is exported as a GeoTIFF (EPSG: 3003), with strict metadata tags enforced to bypass QGIS approximation rendering.

4. REFERENCES FOR THESIS BIBLIOGRAPHY
* Jiang, H., & Eastman, J. R. (2000). Application of fuzzy measures in multi-criteria evaluation in GIS. International Journal of Geographical Information Science, 14(2), 173-184.
* Kephalopoulos, S., Paviotti, M., & Anfosso-Lédée, F. (2012). Common Noise Assessment Methods in Europe (CNOSSOS-EU). EUR 25379 EN. Publications Office of the European Union.
* Malczewski, J. (1999). GIS and Multicriteria Decision Analysis. John Wiley & Sons.
* Mitchell, A. (2005). The ESRI Guide to GIS Analysis, Volume 2: Spatial Measurements and Statistics. ESRI Press.
* O'Sullivan, D., & Unwin, D. J. (2010). Geographic Information Analysis (2nd ed.). John Wiley & Sons.
* Tomlin, C. D. (1990). Geographic Information Systems and Cartographic Modeling. Prentice Hall.
* Zadeh, L. A. (1965). Fuzzy sets. Information and Control, 8(3), 338-353.
================================================================================